import React from 'react'
import {Navigate} from 'react-router-dom'
import {getToken} from '@/utils'
export default function AuthRoute(props) {
 // console.log(props)
  const isToken = getToken()
  if(isToken){
    return (
      <div>{props.children}</div>
    )
  }else{
    return (
      <Navigate to="/login" replace />
    )
  }
  
}
